/*
 *  CS202 - Spring 2009">
 *  Professor: Dr. Michael Peterson">
 *  Student: Deylo Woo (dwoo711@gmail.com) ">
 */
package project_3;

import javax.swing.*;
import java.awt.*;

/**
 * @author deylo
 */
public class Missile extends MovingObject {

    public Missile() {
        super();
        setColor(Color.BLACK);

    }

    public Missile(int xCoord, int yCoord, int height, int width, int rise, int run, Color color) {
        super(xCoord, yCoord, height, width, rise, run, color);

    }


    @Override
    public void Move(int pPanelHeight, int pPanelWidth) {

        if (_xCoord < (0 - _run) || _xCoord > (pPanelWidth - _width)) {
            _run = -_run;
        }

        if (_yCoord < (0 - _rise) || _yCoord > (pPanelHeight - _height)) {
            _rise = -_rise;
            
        }

        _xCoord += _run;
        _yCoord += _rise;
    }
    
}
